package org.amicofragile.springsamples;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainDogAndPerson {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 BeanFactory context = new ClassPathXmlApplicationContext("/simple-context.xml");

		 Dog dog = (Dog)context.getBean("aDog");
		 
		 System.out.println(dog.getName());
		 System.out.println(dog.getOwner().getName());
		 System.out.println(dog.getOwner().getSurname());
		 
		 Person p = new Person("John", "Wayne");
		 Dog d = new Dog("Fido");
		 d.setOwner(p);
	}

}
